﻿using System;

namespace _461_hamming_distance
{
    class Program
    {
        static void Main (string[] args)
        {
            Console.WriteLine (new Solution().HammingDistance(1, 5));
        }
    }

    public class Solution
    {
        public int HammingDistance (int x, int y)
        {
            int num = x ^ y;

            int count = 0;
            while(num > 0)
            {
                if (num % 2 == 1) count++;
                num /= 2;
            }

            return count;
        }
    }
}
